import request from '@/utils/axios'

// 零售出库相关接口
export const retailOutApi = {
  // 获取零售出库列表
  getList: (params) => {
    return request({
      url: '/retail/out/list',
      method: 'get',
      params
    })
  },

  // 新增零售出库
  add: (data) => {
    return request({
      url: '/retail/out/add',
      method: 'post',
      data
    })
  },

  // 编辑零售出库
  update: (data) => {
    return request({
      url: '/retail/out/update',
      method: 'put',
      data
    })
  },

  // 删除零售出库
  delete: (id) => {
    return request({
      url: `/retail/out/delete/${id}`,
      method: 'delete'
    })
  },

  // 查看零售出库详情
  getDetail: (id) => {
    return request({
      url: `/retail/out/detail/${id}`,
      method: 'get'
    })
  },

  // 提交零售出库
  submit: (id) => {
    return request({
      url: `/retail/out/submit/${id}`,
      method: 'post'
    })
  }
}

// 零售退货相关接口
export const retailReturnApi = {
  // 获取零售退货列表
  getList: (params) => {
    return request({
      url: '/retail/return/list',
      method: 'get',
      params
    })
  },

  // 新增零售退货
  add: (data) => {
    return request({
      url: '/retail/return/add',
      method: 'post',
      data
    })
  },

  // 编辑零售退货
  update: (data) => {
    return request({
      url: '/retail/return/update',
      method: 'put',
      data
    })
  },

  // 删除零售退货
  delete: (id) => {
    return request({
      url: `/retail/return/delete/${id}`,
      method: 'delete'
    })
  },

  // 查看零售退货详情
  getDetail: (id) => {
    return request({
      url: `/retail/return/detail/${id}`,
      method: 'get'
    })
  },

  // 提交零售退货
  submit: (id) => {
    return request({
      url: `/retail/return/submit/${id}`,
      method: 'post'
    })
  },

  // 根据出库单号获取出库单信息
  getOutOrderByNo: (orderNo) => {
    return request({
      url: `/retail/out/getByNo/${orderNo}`,
      method: 'get'
    })
  }
} 